package com.hushao.aimi.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 胡少
 */
@ApiModel(value = "分类信息")
@Data
public class CategoryVo implements Serializable {

    private Integer id;

    @ApiModelProperty("父类id")
    private Integer parentId;

    @ApiModelProperty("父类名称")
    private String parentName;

    @ApiModelProperty("类别名称")
    @NotNull(message = "类别名称不能为空！")
    private String name;

    @ApiModelProperty("状态")
    private Boolean status=true;

    @ApiModelProperty("排序编号")
    private Integer sortOrder;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("备注")
    private String comment;

    //子分类
    private List<CategoryVo> childCategroys;

    //商品
    private List<ProductVo> productVos;

    public CategoryVo(Integer id, Integer parentId, String parentName, @NotNull(message = "类别名称不能为空！") String name, Boolean status, Integer sortOrder, LocalDateTime createTime, LocalDateTime updateTime, String comment) {
        this.id = id;
        this.parentId = parentId;
        this.parentName = parentName;
        this.name = name;
        this.status = status;
        this.sortOrder = sortOrder;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.comment = comment;
    }

    public CategoryVo(Integer id, @NotNull(message = "类别名称不能为空！") String name) {
        this.id = id;
        this.name = name;
    }
}
